﻿$(document).ready(function () {
    var sfOptions = {
        animation: { height: 'show' }, // slide-down effect without fade-in
        delay: 500, 		// 1.2 second delay on mouseout
        speed: 'fast',    // speed of the opening animation. Equivalent to second parameter of jQuery’s .animate() method
        speedOut: 'fast',
        cssArrows: false
    }

    $("ul.sf-menu").superfish(sfOptions);

    $("#sitemenu a.itemGroup").click(function () {
        var groupId = $(this).attr("groupId");
        $("#hdnGroupId").val(groupId);
        $("#hdnSubGroupId").val("");

        /*
        console.log("groupId = " + groupId);
        console.log("==================");
        */

        $("#siteForm").submit();
        //return false;
    });

    $("#sitemenu a.itemGroup").each(function () {
        var groupId = $(this).attr("groupId");
        var rel = $(this).attr("id");

        $("a." + rel).click(function () {
            var groupId = $(this).attr("groupId");
            var subGroupId = $(this).attr("subGroupId");
            $("#hdnGroupId").val(groupId);
            $("#hdnSubGroupId").val(subGroupId);

            
            console.log("groupId = " + groupId);
            console.log("subGroupId = " + subGroupId);
            console.log("==================================");
            

            $("#siteForm").submit();
            //return false;
        });
    });
});